#include <iostream>
#include <future>
#include <thread>
#include <chrono>

int Add(int nums1, int nums2)
{
    std::cout << "into add" << std::endl;
    return nums1 + nums2;
}

int main()
{
    std::future<int> res = std::async(std::launch::deferred, Add, 10, 20);
    std::this_thread::sleep_for(std::chrono::seconds(1));

    std::cout << "------------------------" << std::endl;

    std::cout << res.get() << std::endl;

    return 0;
}